﻿using System;
using System.Net;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Documents;
using System.Windows.Ink;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Animation;
using System.Windows.Shapes;
using slTestingStreaming.Framework;
using slTestingStreaming;

namespace slTestingStreaming.Model
{

    public class ModelLocator : Bindable
    {

        [Bindable(Initialize = true)]
        public Manager.TwitterManager TwitterManager { get { return (Manager.TwitterManager)Get("TwitterManager"); } }

        [Bindable(Initialize = true)]
        public Manager.ChatManager ChatManager { get { return (Manager.ChatManager)Get("ChatManager"); } }

        [Bindable(Initialize = true)]
        public Manager.ExtensionManager ExtensionManager { get { return (Manager.ExtensionManager)Get("ExtensionManager"); } }


        private static ModelLocator _instance;

        public static ModelLocator Instance
        {
            get
            {
                if (_instance == null)
                {
                    _instance = new ModelLocator();
                }

                if (App.Current.Resources.Contains("ModelLocator"))
                    return (App.Current.Resources["ModelLocator"] as Model.ModelLocator);
                else
                    return _instance;
            }
        }

        public ModelLocator()
        {
        }

    }

    /*public class ModelLocatorProxy
    {
        public static ModelLocator Instance
        {
            get
            {
                return (App.Current.Resources["ModelLocator"] as Model.ModelLocator);
            }
        }

        public ModelLocatorProxy()
        {}
    }*/
}
